package com.greet.controller.user;

import com.greet.result.Result;
import com.greet.service.DishViewService;
import com.greet.vo.DishVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/dish")
public class DishViewController {
    @Autowired
    private DishViewService dishViewService;

    @GetMapping("/list")
    public Result<List<DishVO>> getDishes(Long categoryId){

        List<DishVO> dishVOList = dishViewService.getDishes(categoryId);
        return Result.success(dishVOList);
    }

}
